//纯js的方式写Vue组件
export default {
    template: `<div>
        <el-button @click="openDialog">弹出dialog</el-button>
        <el-dialog :title="title" :visible.sync="showDialog">
            这是纯js写得Vue组件
            <span slot="footer" >
                <el-button @click="showDialog = false">取 消</el-button>
                <el-button type="primary" @click="showDialog = false">确 定</el-button>
            </span>
        </el-dialog>
    </div>`,
    props: {
        title: String,
    },
    data() {
        return {
            showDialog: false,
        }
    },
    methods: {
        openDialog() {
            console.log("openDialog")
            this.showDialog = true;
        }
    }
}